//#include <iostream>
//#ifndef __CALCULATESERVER_hh__
//#include "SystemAServer.h"
//#include "buyerA.hh"
//
//#endif
//using namespace std;
//using namespace buyer;
//
//CosNaming::NamingContextExt_var inc;
//
//void initService(int argc,char* argv[]){
//	try{
//		CORBA::ORB_var orb = CORBA::ORB_init(argc,argv);
//		
//		//activate ROOT POA
//		CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
//		PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);
//		PortableServer::POAManager_var mgr = poa->the_POAManager();
//		mgr->activate();
//	
//		//get ref of NameService
//		obj = orb->resolve_initial_references("NameService");
//		inc = CosNaming::NamingContextExt::_narrow(obj);
//		cout<<"Got NameService...."<<endl;
//
//		//Calculator_Imp calculator_servant;
//		SystemA_Imp systema_servant;
//		//mCalculate::Calculator_var t1 = calculator_servant._this();
//		SystemA_var s1 = systema_servant._this();
//	
//		CosNaming::Name name;
//		name.length(1);
//		name[0].id = CORBA::string_dup("BuyerSystem");
//		inc->rebind(name,s1);
//		cout<<"SystemA ready and wait..."<<endl;
//
//		orb->run();
//
//	}catch(const CORBA::Exception&){
//		cerr<<"Uncaught CORBA exception."<<endl;
//	}
//
//}
//
//int main(int argc, char* argv[]){
//	initService(argc,argv);
//	return 0;
//}